package com.juxing.webserver.action.live;

import java.util.ArrayList;
import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import com.juxing.service.configCenter.bean.ScenceBean;
import com.juxing.service.liveCenter.ILiveCenterService;
import com.juxing.service.userCenter.IUserCenterService;
import com.juxing.webserver.action.BaseAction;

/**
 * 直播中心-场景
 * @author brochen
 * @mail mongibello@163.com
 * @created 2016年2月2日
 *
 */
@Controller
@RequestMapping("live")
public class ScenceAction extends BaseAction {

	private Logger logger = LoggerFactory.getLogger(ScenceAction.class);
	
	@Autowired
	private ILiveCenterService liveCenterService;
	@Autowired
	private IUserCenterService userCenterService;
	
	/**
	 * 场景列表
	 * @param request
	 * @param response
	 * @return
	 */
	@RequestMapping("scenceList.json")
	public ModelAndView scenceList(HttpServletRequest request, HttpServletResponse response) {
		
		List<ScenceBean> scenceList = new ArrayList<ScenceBean>();
		for(int i = 1; i < 5; i++) {
			ScenceBean bean = new ScenceBean();
			bean.setId(i);
			bean.setName("场景" + i);
			bean.setBgUrl("http://img3.redocn.com/20101213/20101211_0e830c2124ac3d92718fXrUdsYf49nDl.jpg");
			scenceList.add(bean);
		}
		
		ModelAndView view = this.initSuccessView("live/scenceList");
		view.addObject("scenceList", scenceList);
		return this.encryptedView(request, response, view);
		
	}
}
